﻿@model BenzInfo.Hockey.Grenadiers.Models.Player
@using MvcEnumDropDownList.Helpers;

@{
    ViewBag.Title = BenzInfo.Hockey.Grenadiers.Resources.Dictionary.Create;
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script type="text/javascript">

    $(document).ready(function () {
        $('#PositionPlayed').val('@Request["PositionValue"]');
        $('#Year').val('@Request["year"]');
    });

</script>
@Request["year"]
@using (Html.BeginForm("Create", "Players", FormMethod.Post, new { @encType = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>@BenzInfo.Hockey.Grenadiers.Resources.Dictionary.Player</legend>

        @Html.Hidden("teamId", Request["teamId"])

        <div class="editor-label">
            @Html.LabelFor(model => model.PositionPlayed)
        </div>
        <div class="editor-field">
            @Html.EnumDropDownListFor(model => model.PositionPlayed, string.Empty)
            @Html.ValidationMessageFor(model => model.PositionPlayed)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Number)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Number)
            @Html.ValidationMessageFor(model => model.Number)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Picture)
        </div>
        <div class="editor-field">
            <input class="upload" type="file" name="inputFile" id="Picture" />
            @Html.HiddenFor(model => model.Picture)
            @Html.ValidationMessageFor(model => model.Picture)
        </div>
    </fieldset>
}
